package com.shrct.businessprocess.budget.impl;

import com.shrct.businessprocess.budget.RCCostBreakDown;
import com.shrct.businessprocess.budget.RCEX2Budget;
import com.shrct.businessprocess.budget.impl.RCEXBaseBudgetImpl;
import com.shrct.businessprocess.budget.proxy.RCEX2BudgetProxy;
import edu.fudan.mylang.pf.IObjectFactory;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;

@Entity
@DiscriminatorValue("RCEX2BUDGET_TYPE")
public class RCEX2BudgetImpl extends RCEXBaseBudgetImpl implements RCEX2Budget {
  public RCEX2BudgetImpl() {
    super();
  }
  
  public RCEX2BudgetImpl(final RCCostBreakDown cbd) {
    super( cbd);
    
  }
  
  public String getTypeId() {
    return "RCEX2Budget";
  }
  
  public static RCEX2Budget create(final RCCostBreakDown cbd, final IObjectFactory objectFactory) {
    com.shrct.businessprocess.budget.RCEX2Budget rCEX2Budget = new com.shrct.businessprocess.budget.impl.RCEX2BudgetImpl(
    	cbd
    );
    objectFactory.create(rCEX2Budget);
    return rCEX2Budget;			
    
  }
  
  public static RCEX2Budget createRCEX2BudgetImpl(final RCCostBreakDown cbd, final IObjectFactory objectFactory, final Procedure1<RCEX2Budget> init) {
    com.shrct.businessprocess.budget.RCEX2Budget rCEX2Budget = new com.shrct.businessprocess.budget.impl.RCEX2BudgetImpl(
    	cbd
    );
    objectFactory.create(rCEX2Budget);
    init.apply(rCEX2Budget);
    
    return rCEX2Budget;			
    
  }
  
  public RCEX2BudgetProxy toProxy() {
    com.shrct.businessprocess.budget.proxy.RCEX2BudgetProxy proxy = new com.shrct.businessprocess.budget.proxy.RCEX2BudgetProxy();
    proxy.setId(this.getId());
    if(this instanceof edu.fudan.mylang.pf.INamedModelObject){
    	proxy.setName(((edu.fudan.mylang.pf.INamedModelObject)this).getEntityName());
    }
    return proxy;
    
  }
}
